package com.twu.biblioteca.utils;

import com.twu.biblioteca.model.Book;
import com.twu.biblioteca.model.Library;
import com.twu.biblioteca.model.Movie;
import com.twu.biblioteca.model.UserAccount;

import java.util.Set;
import java.util.TreeSet;

/**
 * This is a dummy book generator for the sole purpose of
 * satisfying the requirements of Release 1
 *
 * Created by davecroman on 11/09/2014.
 */
public class AssetGenerator {

    public static Set<Book> generateBooks(){
        Set<Book> books = new TreeSet<Book>();

        books.add( new Book("Harry Potter", "J.K. Rowling", "Scholastic Press") );
        books.add( new Book("The Name of the Wind", "Patrick Rothfuss", "Penguin Group") );
        books.add( new Book("The City of Bones", "Cassandra Clare", "Margaret K. McElderry Books") );
        books.add( new Book("American Gods", "Neil Gaiman", "Headline Review") );
        books.add( new Book("The Dawn Treader", "C.S. Lewis", "HarperCollins") );

        return books;
    }

    public static Set<Movie> generateMovies(){
        Set<Movie> movies = new TreeSet<Movie>();

        movies.add( new Movie.MovieBuilder().setName("The GodFather").setDirector("Francis Ford Coppola").setYear(1972).setRating(10).build() );
        movies.add( new Movie.MovieBuilder().setName("The Shawshank Redemption").setDirector("Frank Darabont").setYear(1994).setRating(9).build() );
        movies.add(new Movie.MovieBuilder().setName("Schindler's List").setDirector("Steven Spielberg").setYear(1993).build());

        return movies;
    }

    public static Library generateStockedLibrary(){
        Library library = new Library();
        library.supplyBooks(generateBooks());
        library.supplyMovies(generateMovies());
        return library;
    }

    public static UserAccount createDefaultUser(){
        return new UserAccount("123-4567", "password").setName("Default User").setEmail("johnSmith@something.com").setPhoneNumber("0434123456");
    }
}
